<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<%@include file="/WEB-INF/common/taglibs.jsp"%>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="${ctx}resources/css/list.css" />
		<script type="text/javascript" src="${ctx}resources/js/page.js"></script>
		<script type="text/javascript" src="${ctx}resources/js/table.js"></script>
		<script type="text/javascript" src="${ctx}resources/js/um.js"></script>
		<title>江苏龙芯梦兰科技股份有限公司-SMT生产管理系统</title>
	</head>
	<script type="text/javascript">
	

	
	$(function(){
		$("#sno").focus();
	});
	function saveMac(){
		var sno = $("#sno").val();
		var m = $("#mac").val();
		if(sno==""){
			alert("请输入主板编号!");
			$("#sno").focus();
			return false;
		}
		if(m==""||m.length<17){
			alert("MAC地址不正确或没有输入 !");
			$("#mac").focus();
			return false;
		}
		var msg="";
		var orderNo = $("#orderNo").val();
		$.ajax({ 
		      url: "${ctx}board/mac.htm?orderNo="+orderNo, 
		      global: false, 
		      type: "POST", 
		      data: ({"mac":m}), 
		      dataType: "json", 
		      async:false, 
		      success: function(data){ 
		        	msg = data.msg;
		         }
	  	});
		 if(msg=="Y"){
        	 alert("MAC地址已存在!");
			$("#sno").focus();
        	 return false;
         }else{
        	$("#macSaveForm").submit();
        	return true;
		}
		return false;
	}
	</script>
	<body>
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td height="30">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td height="24" bgcolor="#353c44">
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td>
												<table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td width="6%" height="19" valign="bottom"> <div align="center"> <img src="${ctx}resources/images/tb.gif" width="14" height="14" /> </div></td>
														<td width="94%" valign="bottom"> <span class="STYLE1"> MAC地址输入基本信息列表</span> </td>
													</tr>
												</table>
											</td>
											<td>
												<div align="right">
													<span class="STYLE1"> 
													</span>
												</div>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
						<form id="mainForm" action="${ctx}board/macList.htm" method="post">
						<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}" />
						<input type="hidden" name="page.orderBy" id="orderBy" value="id" />
						<input type="hidden" name="page.order" id="order" value="asc" />
						<input type="hidden" name="pro_status" id="pstatus" value="0" />
							<tr style="padding-top: 2px">
								<td class="STYLE19" bgcolor="#FFFFFF" colspan="11">
									<span style="padding-left: 40px;">编号:<input type="text" name="filter_LIKES_icNo" value="${param['filter_LIKES_icNo']}" style="width: 80px"> </span>
									<span style="padding-left: 40px;">订单编号:<select name="filter_EQS_orderNo" id="orderNo">
																				<option value="">全部</option>
																				<c:forEach items="${orders}" var="order">
																				  	<option value="${order.orderNo}" ${param['filter_EQS_orderNo']==order.orderNo?"selected":""}>${order.orderNo}</option>
																				</c:forEach>
																			  </select> </span>
									<span style="padding-left: 20px">
									       主板状态: <select name="filter_EQS_status">
												<option value=""> 全部 </option>
												<option value="0" ${param['filter_EQS_status']=='0'?"selected":""}> 良品 </option>
												<option value="1" ${param['filter_EQS_status']=='1'?"selected":""}> 不良品</option>
												<option value="2" ${param['filter_EQS_status']=='2'?"selected":""}> 报废品</option>
											</select>
									       工作状态: <select name="proStauts">
												<option value="0" ${param['proStauts']=='0'?"selected":""}> 生产状态 </option>
												<option value="1" ${param['proStauts']=='1'?"selected":""}> 任务状态</option>
											</select>
									 </span>
									<span style="padding-left: 20px"><input type="button"
											name="" onclick="search();" value="查询"> </span>
								</td>
							</tr>
							</form>
							<tr height="50px">
								<td  class="STYLE19" bgcolor="#FFFFFF"  colspan="12" align="center">
									<form action="${ctx}board/macSave.htm" id="macSaveForm" method="post">
											输入主板编号:<input name="cboardid" id="sno"/>--MAC地址:<input name="mac" id="mac"  onblur="saveMac()"/><input type="button" onclick="saveMac()" value="保存" />
									</form>
								</td>
							</tr>
							<tr>
								<td width="5%" height="20" bgcolor="d3eaef" class="STYLE10">
									<div align="center">
										ID
									</div>
								</td>
								<td height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">板子编号</span>
									</div>
								</td>
								<td  height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">MAC地址</span>
									</div>
								</td>
								<td  height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">订单编号</span>
									</div>
								</td>
								<td  height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">PMON版本</span>
									</div>
								</td>
								<td  height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">程序版本</span>
									</div>
								</td>
								<td height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">系统名称</span>
									</div>
								</td>
								<td  height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">状态</span>
									</div>
								</td>
								<td  height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">当前站点</span>
									</div>
								</td>
								<td  height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">备注</span>
									</div>
								</td>
							</tr>
							<c:forEach items="${page.result}" var="entity" varStatus="i">
								<tr style="background-color: " >
									<td height="20" bgcolor="#FFFFFF">
										<div align="center">
											${entity.id}
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE6">
										<div align="center">
											<span class="STYLE19">${entity.icNo}</span>
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE6">
										<div align="center">
											<span class="STYLE19">${entity.macNo}</span>
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center"> ${entity.orderEntity.orderNo} </div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center"> ${entity.pmonVersion} </div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center"> ${entity.programVersion} </div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center"> ${entity.systemName} </div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center">${entity.status=="0"?"良品":entity.status=="1"?"不良":entity.status=="2"?"报废":""}
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center"> ${entity.flowTask==null?"":entity.flowTask.taskName} </div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center">${entity.remark}</div>
									</td>     
								</tr> 
							</c:forEach> 
						</table>  
					</td>
				</tr> 
				<tr>
					<td height="30">
						<%@include file="/WEB-INF/common/footer.jsp"%>
					</td>
				</tr>
		</table>
	</body>
</html>